<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
<script type="text/javascript">
$(document).ready(function(){
	//只有IE浏览器才会正确
	$("#deptEdit,#deptDelete").hover(function(){
		var x1=$("#deptCode").val();
		$("#deptEdit").attr("href","DeptInfoServlet.do?command=findById&deptCode="+x1);
		$("#deptDelete").attr("href","DeptInfoServlet.do?command=delete&deptCode="+x1);
	});
});
</script>

<form id="pagerForm" method="post" action="DeptInfoServlet.do?command=findByNameAndCode">
	<input type="hidden" name="pageNum" value="1" />
	<input type="hidden" name="numPerPage" value="${param.numPerPage==null?10:param.numPerPage}" />
</form>
<div class="page">
	<div class="pageHeader">
		<form onsubmit="return navTabSearch(this);" action="DeptInfoServlet.do?command=findByNameAndCode" method="post">
		  <input type="hidden"/>
		  <div class="searchBar">
			<ul class="searchContent">
			    <li><label>系部代码：</label><input type="text" name="deptCode" id="deptCode"/></li>
				<li><label>系部名称：</label><input type="text" name="deptName"/></li>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div></li>
			</ul>
	      </div>
		</form>
	</div>
	<div class="pageContent">
		<div class="panelBar">
			<ul class="toolBar">
				<li><a id="deptAdd" class="add" href="LinkServlet.do?command=deptInfoEdit" target="navTab" title="添加系部" rel="DeptInfoEdit"><span>添加</span></a></li>
				<li><a id="deptDelete" class="delete" href="DeptInfoServlet.do?command=delete" target="navTabTodo" title="确定要删除吗?"><span>删除</span></a></li>
				<li><a id="deptEdit" class="edit" href="DeptInfoServlet.do?command=findById" target="navTab" title="修改系部" rel="DeptInfoEdit"><span>修改</span></a></li>
				<li class="line">line</li>
				<li><a class="icon" href="#"><span>导入EXCEL</span></a></li>
				<li><a class="icon" href="#"><span>导出EXCEL</span></a></li>
			</ul>
		</div>
		<table class="table" layouth="138">
			<thead>
				<tr>
					<th style="width:100px;">系部编号</th>
					<th style="width:100px;">系部名称</th>
					<th style="width:200px;">系部说明</th>
				</tr>
			</thead>
			<tbody>
			    <c:forEach items="${deptInfos}" var="deptInfo">
			        <tr target="deptCode" rel="${deptInfo.deptCode}">
			          <td>${deptInfo.deptCode}</td>
			          <td>${deptInfo.deptName}</td>
			          <td>${deptInfo.deptDesc}</td>
			        </tr>
			    </c:forEach>
			</tbody>
		</table>
		<div class="panelBar">
			<div class="pages">
				<span>显示</span>
				<select name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
					<option value="10" ${param.numPerPage==10?"selected":""}>10</option>
					<option value="20" ${param.numPerPage==20?"selected":""}>20</option>
					<option value="30" ${param.numPerPage==30?"selected":""}>30</option>
					<option value="40" ${param.numPerPage==40?"selected":""}>40</option>
				</select>
				<span>条，共${totalCount}条</span>
			</div>
			<div class="pagination" targetType="navTab"  pageNumShown="4" totalCount="${totalCount}" numPerPage="${numPerPage}"  currentPage="${currentPage}"></div>
		</div>
	</div>
</div>
